import cv2

# 读取图像
image = cv2.imread('image.jpg')

# 应用双边滤波
smoothed_image = cv2.bilateralFilter(image, 9, 75, 75)  # 9是邻域直径，75是颜色空间和坐标空间的标准差

# 显示结果
cv2.imshow('Original Image', image)
cv2.imshow('Smoothed Image (Bilateral Filter)', smoothed_image)
cv2.waitKey(0)
cv2.destroyAllWindows()